<%--
  Created by IntelliJ IDEA.
  User: Mr.Feng
  Date: 2023/6/2
  Time: 21:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div class="modal fade" id="registerModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title" id="myModalLabel">用户注册</h4>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <!-- 注册表单 -->
        <form action="${pageContext.request.contextPath}/addUser" method="post">
          <div class="form-group">
            <label >邮箱</label>
            <input type="email" class="form-control" name="email" placeholder="请输入邮箱">
          </div>
          <div class="form-group">
            <label >用户名</label>
            <input type="text" class="form-control" name="name" placeholder="请输入用户名">
          </div>
          <div class="form-group">
            <label >密码</label>
            <input type="password" class="form-control" name = "password" placeholder="请输入密码">
          </div>
          <c:if test="${USER_SESSION.role=='ADMIN'}">
            <label> 用户身份</label>
            <select name="role">
              <option value="ADMIN"> 管理员</option>
              <option value="USER"> 普通用户</option>
            </select>
          </c:if>
          <button type="submit" class="btn btn-primary">注册</button>
        </form>
      </div>
    </div>
  </div>
</div>